package com.nineclock.message.listener;

import com.nineclock.message.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "allowedJoinCompanyTopic",consumerGroup = "consumerGroup22")
public class AllowedJoinCompanyListener implements RocketMQListener<String> {

    @Autowired
    MessageService messageService;

    @Override
    public void onMessage(String msgId) {
        messageService.updateMessageWithApproved(msgId);
    }
}
